package cn.edu.cug.cs.gtl.oi.inventor.demo;

import cn.edu.cug.cs.gtl.oi.utils.Example;
import cn.edu.cug.cs.gtl.oi.utils.ViewerComponentsFactory;
import com.openinventor.inventor.nodes.SoCone;
import com.openinventor.inventor.nodes.SoMaterial;
import com.openinventor.inventor.nodes.SoSeparator;
import com.openinventor.inventor.viewercomponents.awt.IViewerExaminer;
import com.openinventor.inventor.viewercomponents.awt.glcanvas.viewers.ViewerExaminer;

import java.awt.*;

public class RedCone extends Example {

    private ViewerExaminer viewer;

    @Override
    public void start() {
        viewer = new ViewerExaminer();

        SoSeparator root = new SoSeparator();
        SoMaterial material = new SoMaterial();
        material.diffuseColor.setValue(1.0f, 0.0f, 0.0f);
        root.addChild(material);
        root.addChild(new SoCone());

        viewer.setSceneGraph(root);

        viewer.viewAll();
        viewer.setPreferredSize(new java.awt.Dimension(500, 500));
        add(viewer, BorderLayout.CENTER);
    }

    @Override
    public void stop() {

    }

    public static void main(String[] args) {
        RedCone example = new RedCone();
        example.demoMain("Red Cone");
    }
}
